package bma.shop.web.product;

import org.springframework.beans.factory.annotation.Autowired;

import bma.shop.web.event.ApplicationEvents;
import bma.shop.web.event.ApplicationEvents.ApplicationStartEvent;
import bma.shop.web.event.BaseEvent;
import bma.shop.web.event.EventManager;
import bma.shop.web.event.ViewEventListener;

@SuppressWarnings("serial")
public class ProductController implements ViewEventListener {

	@Autowired
	private EventManager eventManager;
	
	@Autowired
	private ProductContainerView view;

	public void init() {
		eventManager.subscribe(ApplicationEvents.APPLICATION_START_EVENT, this);
	}

	public void handleEvent(BaseEvent event) {
		if (event instanceof ApplicationStartEvent) {
			view.test();
		}
	}
}
